Skip to content

chore: modernize RakNet to current C++ and CMake standards#1

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/update-codebase-to-new-standards
Draft

chore: modernize RakNet to current C++ and CMake standards#1
Copilot wants to merge 2 commits intomasterfrom
copilot/update-codebase-to-new-standards

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 30, 2026

  • Analyse codebase for bugs
  • DS_List.h line 278 – Loop uses counter != position (unsigned) instead of counter > position; if position > list_size in a release build (assert only fires in _DEBUG) the loop never terminates and corrupts memory
  • RakString.cpp line 1477memcpy(sharedString->c_str, bytes, count+1) reads one byte past the caller's input buffer and can overflow the internal smallString buffer when count == smallStringSize; fix: copy only count bytes (null terminator is set on the next line)
  • RakNetTypes.cpp line 105strcpy(hostAddress, _hostAddress) has no length guard; hostAddress is only 32 bytes, an IPv6 address literal longer than 31 chars overflows it; fix: use strncpy with explicit null-termination

…, remove register keyword

Agent-Logs-Url: https://github.com/Avedith/RakNet/sessions/d2ab6864-5686-4714-806d-84523179c438

Co-authored-by: Avedith <65852834+Avedith@users.noreply.github.com>
Copilot AI requested a review from Avedith April 30, 2026 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants